﻿using Dapper;
using System;
using BCEntity.MySql.BusinessFlowInstance;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.MySql.BusinessFlowInstance
{
    /// <summary>
    /// OA系统业务流实例
    /// </summary>
    public interface IBusinessFlowInstanceData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="businessFlowInstanceId">OA系统业务流实例Id</param>
        Task<bool> Exists(long businessFlowInstanceId);
        /// <summary>
        /// 是否在使用
        /// </summary>
        /// <param name="businessFlowModelId">业务流模型Id</param>
        /// <returns></returns>
        Task<bool> InUsed(long businessFlowModelId);
        
        /// <summary>
        /// 增加OA系统业务流实例
        /// </summary>
        /// <param name="entity">OA系统业务流实例信息</param>
        Task<BusinessFlowInstanceEntity> Add(BusinessFlowInstanceEntity entity);
        /// <summary>
        /// 更新OA系统业务流实例
        /// </summary>
        /// <param name="entity">OA系统业务流实例信息</param>
        Task<BusinessFlowInstanceEntity> Update(BusinessFlowInstanceEntity entity);
        /// <summary>
        /// 删除OA系统业务流实例
        /// </summary>
        /// <param name="businessFlowInstanceId">OA系统业务流实例Id</param>
        Task<bool> Delete(long businessFlowInstanceId);
        /// <summary>
        /// 获取OA系统业务流实例
        /// </summary>
        /// <param name="businessFlowInstanceId">OA系统业务流实例Id</param>
        Task<BusinessFlowInstanceEntity> GetEntity(long businessFlowInstanceId);
        /// <summary>
        /// 获取OA系统业务流实例列表
        /// </summary>
        Task<IEnumerable<BusinessFlowInstanceEntity>> GetList(int companyId);
        /// <summary>
        /// 获取OA系统业务流实例分页列表
        /// </summary>
        /// <param name="businessFlowModelId">OA系统业务流模板Id</param>
        /// <param name="businessFlowInstanceName">OA系统业务流实例名称</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">OA系统业务流实例每页数据条数</param>
        Task<(IEnumerable<BusinessFlowInstanceEntity>, int)> Query(long? businessFlowModelId,string businessFlowInstanceName, DateTime? start, DateTime? end, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}